function rectParenthesis(node) {

	var tempCaret;
	var parent;

	caret=superOperatorInsert(caret,"parenthesis");
		
	parent=caret;
	
	caret=subOperatorAppend(caret,"up");
	
	caret=contentNodeAppend(caret,1); // 1 meaning the same level. 
	
	tempCaret=auxOperatorAppend(parent,"left");
	
	tempCaret.node.text("[");
	
	tempCaret.node.attr('font','symbol');
		
	tempCaret=auxOperatorAppend(parent,"right");
	
	tempCaret.node.text("]");
	
	tempCaret.node.attr('font','symbol');
		

}

function curlyParenthesis(node) {

	var tempCaret;
	var parent;

	caret=superOperatorInsert(caret,"parenthesis");
		
	parent=caret;
	
	caret=subOperatorAppend(caret,"up");
	
	caret=contentNodeAppend(caret,1); // 1 meaning the same level. 
	
	tempCaret=auxOperatorAppend(parent,"left");
	
	tempCaret.node.text("{");
	
	tempCaret.node.attr('font','symbol');
		
	tempCaret=auxOperatorAppend(parent,"right");
	
	tempCaret.node.text("}");
	
	tempCaret.node.attr('font','symbol');
		

}

function regularParenthesis(node) {

	var tempCaret;
	var parent;

	caret=superOperatorInsert(caret,"parenthesis");
		
	parent=caret;
	
	caret=subOperatorAppend(caret,"up");
	
	caret=contentNodeAppend(caret,1); // 1 meaning the same level. 
	
	tempCaret=auxOperatorAppend(parent,"left");
	
	tempCaret.node.text("(");
	
	tempCaret.node.attr('font','symbol');
		
	tempCaret=auxOperatorAppend(parent,"right");
	
	tempCaret.node.text(")");
	
	tempCaret.node.attr('font','symbol');
		

}

function offSetForParenthesis(node) { // 0:up, 1: left, 2: right. legacy
	
	var contentUpOffSet,contentDownOffSet;
	var thisHeight,thisWidth, destLeft,destBottom;
	var selfHeight;

	contentUpOffSet=upOffSetChildren(node.children[0]);
	
	contentDownOffSet=downOffSetChildren(node.children[0]);
// filling the metric matrix
	
	thisWidth=node.children[0].width;
	thisHeight=node.children[0].height;
	
	node.height=thisHeight+contentUpOffSet+contentDownOffSet;
	
	destBottom=-(node.height-thisHeight)/2+contentDownOffSet;
	destLeft=thisHeight/6;
	
	node.children[0].node.css('left',destLeft);
	node.children[0].node.css('bottom',destBottom);
	
	node.upOffSet=(node.height-thisHeight)/2;
	node.downOffSet=node.upOffSet;	

	node.width=thisWidth+thisHeight/3;
// left

// there are many of the fine tune-ment..
	
	selfHeight=node.children[1].node.height()-10;
	
	node.children[1].node.css('left',0);
	node.children[1].node.css('bottom',0);
	
	node.children[1].node.css('transform','scaleY('+node.height/selfHeight+')');
	node.children[1].node.css('transform-origin','50% 52%');
	node.children[1].node.css('-webkit-transform','scaleY('+node.height/selfHeight+')');
	node.children[1].node.css('-webkit-transform-origin','50% 52%');
	node.children[1].node.css('-moz-transform','scaleY('+node.height/selfHeight+')');
	node.children[1].node.css('-moz-transform-origin','50% 52%');
	node.children[1].node.css('-o-transform','scaleY('+node.height/selfHeight+')');
	node.children[1].node.css('-o-transform-origin','50% 52%');
	node.children[1].node.css('-ms-transform','scaleY('+node.height/selfHeight+')');
	node.children[1].node.css('-ms-transform-origin','50% 52%');
	//right

	node.children[2].node.css('left',node.width-destLeft*1.1);
	node.children[2].node.css('bottom',0);
	
	node.children[2].node.css('transform','scaleY('+node.height/selfHeight+')');
	node.children[2].node.css('transform-origin','50% 52%');
	node.children[2].node.css('-webkit-transform','scaleY('+node.height/selfHeight+')');
	node.children[2].node.css('-webkit-transform-origin','50% 52%');
	node.children[2].node.css('-moz-transform','scaleY('+node.height/selfHeight+')');
	node.children[2].node.css('-moz-transform-origin','50% 52%');
	node.children[2].node.css('-o-transform','scaleY('+node.height/selfHeight+')');
	node.children[2].node.css('-o-transform-origin','50% 52%');
	node.children[2].node.css('-ms-transform','scaleY('+node.height/selfHeight+')');
	node.children[2].node.css('-ms-transform-origin','50% 52%');

	
	
	node.height=thisHeight; // restore
	
}
// offset functions